<template>
    <div class="page createTemporary-page" data-page="shifts-details" style="z-index: 2; ">
        <div class="link-page-nav">
            <a href="#" class="link" @click=goBack> <i class="iconfont icon-zuo"></i>
            </a>

        </div>
        <div class="link-page-top">
            <div class="link-page-title">值班记录单
                <a class="link popover-open" data-popover="#dector_menu_details" id="dector_menu_right">
                    <i class="iconfont icon-APPicon_gengduo" style="float: right;font-size: 24px;"></i>
                </a>

            </div>
        </div>
        <div class="page-content infinite-scroll-content ptr-content" style="padding: 0 20px 120px 20px;height: 100%;"
            data-infinite-distance="50" @ptr:refresh="refreshHistoryPolice2" id="shiftsDetails">
            <div>
                <div class="ptr-preloader" style="top: -40px;">
                    <div class="preloader color-multi"></div>
                    <div class="ptr-arrow"></div>
                </div>
                <div class="shiftsDetailsTop">

                </div>
                <div>
                    <div class="section-title">
                        相关任务
                    </div>
                    <div class="fireWorkItems">
                    </div>
                    <div class="houseItemsDetails"></div>
                    <div class="fireCheckItemsDetails" style="padding-bottom:60px"></div>
                </div>
            </div>
            <div class="popover select-option-con" id="dector_menu_details">
                <div class="popover-angle"></div>
                <div class="popover-inner">
                    <div class="list">
                        <ul>
                            <li><a href="" class="list-button item-link popover-close" id="copyItem"
                                    @click="copyItem(0)">复制</a>
                            </li>
                            <li><a href="" class="list-button item-link popover-close" id="editItem"
                                    @click="editItem(1)">编辑</a></li>
                            <li><a href="" class="list-button item-link popover-close" id="deleteItem"
                                    @click="deleteItem">删除</a></li>
                        </ul>
                    </div>
                </div>
            </div>
           

        </div>
        <div class="fixedBtnShifts" @click="shiftsFun">
            <i class="iconfont icon-erweima"></i><span>现场交班</span>
            <p style="font-size: 12px;color:rgba(255,255,255,.5);">*请在下班后四小时内完成交接班</p>
        </div>
    </div>
</template>
<style>
    .fixedBtnShifts {
        width: 100%;
        height: 58px;

        background: #2471CA;
        position: fixed;
        left: 0;
        bottom: 0;
        color: #ffffff;
        text-align: center;
        font-size: 18px;
        z-index: 2;
        display: none;
    }

    .fixedBtnShifts i {
        color: #ffffff;
        margin-top: 6px;
        display: inline-block;
    }



    .fixedBtnShifts p {
        color: rgba(255, 255, 255, .5);
        font-size: 12px;
        ;
    }

    .shiftsDetails li {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        font-size: 14px;
        margin-bottom: 20px;
        color: #333333;
    }

    .shiftsDetails li div:nth-child(1) {
        margin-right: 20px;
        color: #999999;

    }

    .flex-label {
        width: 70px;
    }

    .shiftsDetails .section-title {
        font-size: 18px;
        font-weight: bold;
    }

    .onDuty {
        color: #2471CA !important;
        font-size: 16px !important;
        font-weight: 500 !important;
    }

    .successFulDuty {
        color: #69BA71 !important;
        font-size: 16px !important;
        font-weight: 500 !important;
    }

    .noDuty {
        color: #E07762 !important;
        font-size: 16px !important;
        font-weight: 500 !important;
    }

    table {

        border-top: #E1E1E1 solid 1px;
        width: 100%;
        text-align: center;
    }

    .dutyName {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        flex-wrap: wrap;
        text-align: center;
    }

    .dutyName img {
        width: 55px;
        height: 55px;
        border-radius: 50%;
        background: rgba(153, 153, 153, 1);
        border: 1px solid rgba(255, 255, 255, 1);
        box-shadow: 0px 1px 7px 0px rgba(85, 85, 85, 0.17);
    }

    .dutyName a {
        color: #333333;
        display: block;
        margin-right: 10px;
    }

    td,
    th {
        border-right: 1px solid #E1E1E1;
        border-bottom: 1px solid #E1E1E1;
        padding: 5px 0;
    }

    table th:last-child {
        border-right: 0
    }

    table td:last-child {
        border-right: 0
    }

    .section-title {
        font-size: 18px;
        color: #333333;
        font-weight: bold;
    }

    .line-bottom {
        border-bottom: 1px solid #E1E1E1;
        margin-bottom: 30px;
    }

    .changeShiftsResult {
        display: none;
    }

    .changeShiftsResult .section-title {
        margin-bottom: 20px;
    }

    .changeShiftsResultLabel {
        color: #999999;
        display: inline-block;
        padding-bottom: 25px;
        margin-top: 15px;
    }

    .flex-between {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 10px;
    }

    .tableItem {
        background: rgba(225, 225, 225, .3);
        margin-bottom: 10px;
        border-radius: 2px;
        font-size: 12px;
    }

    .tableItemTitle {
        padding: 20px 0
    }

    .fireWorkItemsTitle {
        margin: 20px 0;
        font-size: 14px;
        font-weight: bold;
        color: #333333;
    }

    .tableDetails {
        display: none;
    }

    .introduceDetails {
        padding: 15px 10px;
        ;
    }

    .introduce-text {
        color: #999999;
        margin-top: 10px;
    }

    .addList {
        display: none;
        text-align: center;
        background: rgba(255, 255, 255, 1);
        border: 1px solid rgba(215, 215, 215, 1);
        border-radius: 2px;
        color: #2471CA;
    }

    .addList span {
        font-size: 26px;
        display: inline-block;
        vertical-align: middle
    }

    .domShow {
        display: block !important;
    }

    .popup-fire-content li {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-top: 20px;
        ;
    }

    .poupp-right {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        /* border: 1px solid rgba(153, 153, 153, .2); */
        border-radius: 4px;
        text-align: center;
        height: 34px;
        line-height: 34px;
    }

    .poupp-right div {
        height: 34px;
        line-height: 34px;
    }

    .poupp-right .tab {
        width: 65px;
        background: rgba(240, 240, 240, .8);
        color: #333333;
        border: 1px solid rgba(153, 153, 153, .2);
        border-left: 0;
    }

    .poupp-right .tab:last-child {
        border-top-right-radius: 4px;
        border-bottom-right-radius: 4px;
    }

    .poupp-right .tab:nth-child(1) {
        border-left: 1px solid rgba(153, 153, 153, .2);
        border-top-left-radius: 4px;
        border-bottom-left-radius: 4px;
    }

    .poupp-right .popup-active.tab {
        background: #2471CA;
        color: #ffffff;
    }

    .poupp-right .jian {
        border-top-left-radius: 4px;
        border-bottom-left-radius: 4px;
    }

    .poupp-right .jia {
        border-top-right-radius: 4px;
        border-bottom-right-radius: 4px;
    }

    .poupp-right .jian,
    .poupp-right .jia {
        border: 1px solid rgba(153, 153, 153, .2);
        width: 36px;
        background: rgba(153, 153, 153, .2);
    }

    .dector-popup input {
        width: 58px !important;
        text-align: center;
        border-top: 1px solid rgba(153, 153, 153, .2);
        border-bottom: 1px solid rgba(153, 153, 153, .2);
    }

    .popup-textarea {
        border: 0;
        border-bottom: 1px solid #D2D2D2;
        resize: none;
        height: 40px !important;
        ;
    }

    .popupBtnFixed {
        position: absolute;
        left: 0;
        bottom: 0;
        height: 58px;
        width: 100%;
        text-align: center;
        font-size: 0;
        border-top: 1px solid #E1E1E1;
        z-index: 2;
        background: #FFF;
    }

    .popupBtnFixed div {
        height: 58px;
        width: 50%;
        display: inline-block;
        font-size: 18px;
        line-height: 58px;
    }

    .popup-confirm {
        background: #2471CA;
        color: #ffffff;
    }

    #slideBox {
        position: fixed;
        height: 50%;
        bottom: 0;
        left: 0;
        right: 0;
        border-top-left-radius: 20px;
        border-top-right-radius: 20px;
        box-shadow: 0 -10px 10px 5px rgba(0, 0, 0, 0.3);
        transform: translate3d(0, 73%, 0);
        z-index: 9000;
        background-color: #fff;
        transition: transform 300ms;
    }

    #slideBox.show {
        transform: translate3d(0, 0, 0);
    }

</style> 

<script>
    return {
        data() {
            return {
                id: this.$route.params.id,
                runStatus: 0,
                zj: 0,
                xy: 0,
                fw: 0,
                zdy: 0,
                bydy: 0,
                systemStatus: 0,
                fireAlarmCount: 0,
                errorReportCount: 0,
                faultAlarmCount: 0,
                superviseAlarmCount: 0,
                missReportCount: 0,
                handleDesc: '',
                userName: this.$route.params.createAccount,
                orgId: '',
                controlName: '',
                dutyAccount: '',
                shiftsEndTime: '',
                shiftsStartTime: '',
                pageName: 'changeShiftsDetails',
                flagAppend: true,
                time: '',
                visualCode:''

            }
        },
        on: {
            pageAfterOut: function (e, page) {
                //outPage  sort 1  
                //Do:离开页面后
                // jQuery('.QrpopupBtnFixed').hide()
                jQuery('#slideBox').remove()
                changeShiftsId=-1
                clearInterval(this.time)
            }
        },
        mounted() {
            let self = this
            this.getData()
            this.Qrpupop()
            this.partMan = userInfor.accountName
            this.selectOptionIndex2 = userInfor.accountName;
            this.selectOptionType = 1;
            window.QRid=self.id
            if (this.$route.params.name == 0) {//成功交班
                jQuery('.fixedBtnShifts').hide()
            }
        },
        methods: {
            setIntervalQr:function(){
                let self=this
                if (this.$route.params.name != 1 && this.$route.params.name != 0) {
                if (jQuery('#qrcode').length == 1) {
                    self.time&&clearInterval(self.time)
                    self.time = setInterval(res => {
                        jQuery('#qrcode').empty()
                        let timestamp;
                        timestamp = (new Date()).getTime();
                        if (jQuery('#qrcode').length== 1) {
                            new QRCode(document.getElementById("qrcode"), {
                                text: self.visualCode + '?' + timestamp,
                                width: 174,
                                height: 174
                            });
                        } else {
                            clearInterval(self.time)
                        }
                    }, 60000)
                }else {
                clearInterval(self.time)
            }
            } 
            },
            refreshHistoryPolice2: function (e, done) {
                if (done && e) {
                    var self = this;
                    var $ = self.$$;
                    setTimeout(function () {
                        $('#history_preloader2').hide();
                        self.$route.params.name =-1
                        self.getData();
                        done();
                    }, 1000);
                }
            },
            backToRefresh: function () {
                var self = this;
                self.getData()
                self.Qrpupop()
            },
            goBack: function () {
                jQuery('#slideBox').remove()
                QrStatus = false
                app.methods.backToTab();
            },
            // 扫码数据弹窗
            Qrpupop: function () {
                if (QrStatus) {
                    jQuery('#dector_menu_right').hide()
                    if (this.$route.params.name == 0) {
                        jQuery('.fixedBtnShifts').hide()
                    }
                    let self = this
                    let html6 = `
                    <div id="slideBox" class="show" >
                    <div id="touchBtn"0  style="padding:20px 0">
                        <div class="slideLine" style=" width:100px;
                            height:6px;
                            border-radius: 3px;
                            background:#333;
                            margin:0 auto;">
                        </div>
                    </div>
                        <div  style="text-align:center" id="slideContent">
                                <i class="iconfont icon-gantanhao-" style="color:#F3BC32;font-size:120px;"></i>
                                <p>请先复核值班记录再交接班!</p>
                        </div>
                        <div class="popupBtnFixed QrpopupBtnFixed" >
                            <div class="popup-cancel">拒绝</div>
                            <div class="popup-confirm">同意交接班</div>
                            </div>
                    </div>`
                    jQuery('body').append(html6)
                    var hide = false;
                    var maxH = 100; // 触发临界值
                    var startY = 0;
                    var box = document.getElementById('slideBox')
                    document.getElementById('touchBtn').ontouchstart = function (e) {
                        startY = e.changedTouches[0].clientY
                        this.ontouchend = function (e) {
                            var clientY = e.changedTouches[0].clientY
                            if (Math.abs(clientY - startY) >= maxH) { //达到临界值
                                if (hide) { //展开
                                    if (clientY < startY) {//上滑
                                        box.className = 'show'
                                        hide = false
                                    }
                                } else if (clientY > startY) { //下滑
                                    box.className = ''
                                    hide = true
                                }
                            }
                        }
                    }
                    jQuery('body').off('click', '.popup-cancel').on('click', '.popup-cancel', function () {
                        jQuery('.QrpopupBtnFixed').hide()
                        let params = {
                            type: 1,
                            userName: userInfor.accountName,
                            dutyAccount: self.dutyAccount,
                            orgId: self.orgId,
                            id: self.id
                        }
                        Dao.updateShiftsStatus(params, function () {
                            jQuery('#slideBox').remove()
                            QrStatus = false
                            app.methods.backToTab();
                        })
                    })

                    jQuery('body').off('click', '.popup-confirm').on('click', '.popup-confirm', function () {
                        jQuery('.QrpopupBtnFixed').remove()
                        jQuery('#slideBox').css({ 'height': '90%' })
                        // self.data.shiftsEndTime
                        let params = {
                            type: 0,
                            status: 1,
                            userName: userInfor.accountName,
                            dutyAccount: self.data.dutyAccount,
                            orgId: self.data.orgId,
                            id: self.data.id,
                            shiftsTimeStr: moment().locale('zh-cn').format('YYYY-MM-DD HH:mm:ss'),
                            shiftsAccount: userInfor.accountName
                        }
                        Dao.updateShiftsStatus(params, function () { })//更新交班
                        html6 = `
                                <span class="bind-all-unit" style="font-size:18px; text-align:center;display:block">请创建自己的值班记录单</span>
                          
                                    <div style="text-align:left;padding: 0 20px;box-sizing: border-box;">

                                    <div class="inItem" style="margin-bottom:20px;">
                                        <div style="margin-bottom:10px;color:#333333;font-size:18px;"><span style="color:red">*</span>所在单位</div>
                                        <a href="#" id="temporaryTask_select_org" style="color:#333;display:block;width:100%"><span id="temporaryTask_org" style="">请您选择所在的单位</span><i
                                                class="iconfont icon-jiantou" style="float:right;color:#333" id="temporaryTask_arr_org"></i></a>
                                    </div>

                                    <div class="inItem" style="margin-bottom:20px;">
                                        <div style="margin-bottom:10px;color:#333333;font-size:18px;"><span style="color:red">*</span>值班人员</div>
                                        <a href="#" id="selectTemporaryJoner" @click="select_tip" style="display: block;color:#333;width:100%"><span
                                                id="temporaryJoiner">选择其他参与人员（多选）</span><i class="iconfont icon-jiantou" style="float:right;color:#333;"></i></a>
                                    </div>
                                    <div class="inItem" style="margin-bottom:20px;">
                                        <div style="margin-bottom:10px;color:#333333;font-size:18px;"><span style="color:red">*</span>所在消控室</div>
                                        <input type="text" placeholder="输入所在消控室名称" class="controlRoom" id="controlRoom" style="width:100%!important;border-top:0;text-align:left">
                                    </div>

                                    <div class="inItem">
                                        <div style="margin-bottom:10px;color:#333333;font-size:18px;">值班时间段<label>(必选)</label> <span style="color:#E54C2E;font-size:14px;float:right"
                                                class="copyTimeTip"></span>
                                        </div>
                                        <a href="#" id="start_time_fun" style="display:block;color:#333;margin-bottom:10px"><span id="start_time">选择开始时间</span><i
                                                class="iconfont icon-jiantou" style="float:right"></i></a>
                                        <a href="#"id="end_time_fun"  style="display:block;color:#333"><span id="end_time">选择结束时间</span><i
                                                class="iconfont icon-jiantou" style="float:right;color:#333"></i></a>
                                    </div>
                                    </div>
                                
                                <div class="popupBtnFixed">
                                     <div class="popup-confirm" style="width:100%">完成</div>
                                </div>
                                `;
                        $('#slideContent').html(html6)
                        self.temporaryTaskInitOrg()
                        self.htmlGetUnitUsers()
                        var s;
                        var e;
                        var myDate;
                        let u = navigator.userAgent;
                        if (!!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)) {
                            s = new Date(self.data.shiftsStartTime.replace(/-/g, '/')).getTime()
                            e = new Date(self.data.shiftsEndTime.replace(/-/g, '/')).getTime()
                            myDate = new Date(e + e - s);
                        } else {
                            s = new Date(self.data.shiftsStartTime).getTime()
                            e = new Date(self.data.shiftsEndTime).getTime()
                            myDate = new Date(e + e - s);
                        }
                        jQuery('#start_time').text(self.data.shiftsEndTime.substring(0,16))
                        jQuery('#end_time').text(moment(myDate).format('YYYY-MM-DD HH:mm'))
                        jQuery('#temporaryJoiner').text(userInfor.name)
                        jQuery('#controlRoom').val(self.controlName)
                        jQuery('#temporaryTask_org').text(self.name)
                        self.currentOrgId = self.data.orgId
                        // creatNewPopup(html7, function () {
                        jQuery('body').off('click', '#start_time_fun').on('click', '#start_time_fun', function () {
                            self.openTime('start')
                        })
                        jQuery('body').off('click', '#end_time_fun').on('click', '#end_time_fun', function () {
                            self.openTime('end')

                        })
                        jQuery('body').off('click', '.popup-confirm').on('click', '.popup-confirm', function () {
                            let params = {
                                id: 0,
                                orgId: self.currentOrgId,
                                controlName: jQuery('#controlRoom').val(),
                                dutyAccount: self.partMan,
                                shiftsStartTimeStr: jQuery('#start_time').text()+':00',
                                shiftsEndTimeStr: jQuery('#end_time').text()+':00',
                                userName: userInfor.accountName
                            }
                            if (self.currentOrgId == "" || self.currentOrgId == undefined || jQuery('#temporaryTask_org').text() == '请您选择所在的单位') {
                                app.methods.showToastCenter("请选择单位");
                                return;
                            }
                            if (jQuery('#controlRoom').val() == '') {
                                app.methods.showToastCenter('消控室必填');
                                return
                            }
                            Dao.saveShiftsRecord(params, function () {//创建
                                app.methods.showToastCenter('您已接班成功');
                                QrStatus = false
                                setTimeout(res => {
                                    jQuery('.QrpopupBtnFixed').hide()
                                    app.popup.close();
                                    app.methods.backToTab();
                                    // app.view.current.router.back()
                                }, 2000)
                            })
                        })
                    })
                }
            },
            htmlGetUnitUsers: function () {
                var self = this;
                //多选  值班人员
                jQuery("#selectTemporaryJoner").click(function (e) {
                    self.flag = false
                    if (!self.currentOrgId) {
                        app.methods.showToastCenter('请选择单位');
                        return;
                    }
                    // self.selectOptionIndex1 = "";

                    // self.selectOptionIndex3 = "";
                    // self.selectOptionIndex4 = null;
                    let data = {
                        id: self.partMan,
                        index: self.selectOptionIndex2,
                        name: self.selectOptionType,
                        type: 1
                    }

                    getFourTypeUser(self.currentOrgId, function (data) {
                        if (data.id.indexOf(userInfor.accountName) < 0) {
                            app.methods.showToastCenter('当前用户，不可取消');
                        } else {
                            if (data.index) {
                                self.partMan = data.id;
                                self.selectOptionIndex2 = data.index;
                                self.selectOptionType = data.type;
                                $("#temporaryJoiner").css("color", "#333").html(data.name);
                            } else {
                                self.partMan = "";
                                self.selectOptionIndex2 = "";
                                self.selectOptionType = "";
                                $("#temporaryJoiner").css("color", "rgba(153, 153, 153, 1)").html("选择其他参与人员（多选）");
                            }
                        }
                    }, self.selectOptionIndex2, self.selectOptionType, true);

                });
            },
            //时间
            openTime: function (type) {
                var self = this;
                let resetTime
                if (type == 'start') {
                    resetTime=jQuery(`#start_time`).text()
                }else{
                    resetTime=jQuery(`#end_time`).text()
                }
                loadSelectedDate_Fn(1, function (data) {
                    let time = new Date(data.singleDate).getTime()
                    if (type == 'start') {
                        self.startTime = data.singleDate.substring(0,17);
                        if (time > new Date(jQuery('#end_time').text()).getTime() && jQuery('#end_time').text() != '') {
                            app.methods.showToastCenter("开始时间必须小于时间");
                            return;
                        } else {
                            $("#start_time").html(data.singleDate.substring(0,17));
                        }
                    } else {
                        self.endTime = data.singleDate.substring(0,17);
                        let time2 = new Date(data.singleDate).getTime()
                        if (time < new Date(jQuery('#start_time').text()).getTime() && jQuery('#start_time').text() != '') {
                            app.methods.showToastCenter("结束时间必须大于开始时间");
                            return;
                        } else {
                            $("#end_time").html(data.singleDate.substring(0,17));
                        }
                    }
                },resetTime);
            },

            //初始化联网单位
            temporaryTaskInitOrg: function () {
                var self = this;
                if (userInfor.isMuilUnitUser == 1) { //多联网单位角色
                    jQuery("#temporaryTask_select_org").show().click(function (e) {
                        self.selectOptionOrg = self.data.orgId
                        loadSelectUnitFunc(function (data) {
                            if (self.selectOptionOrg != data.orgId) {
                                self.selectOptionOrg = data.orgId;
                                self.currentOrgId = data.orgId;
                                jQuery("#temporaryTask_org").html(data.orgName);
                                $("#temporaryTask_org").css("color", "#333333");
                            } else {
                                self.selectOptionOrg = 0;
                                jQuery("#temporaryTask_org").html('请您选择所在的单位');
                                if (single_Orgid == "") {
                                    self.currentOrgId = userInfor.organizationIds;
                                } else {
                                    self.currentOrgId = single_Orgid;
                                }
                            }
                        }, false, self.selectOptionOrg);
                    });
                } else { //单联网单位角色
                    $("#temporaryTask_arr_org").hide();
                    self.currentOrgId = single_Orgid;

                    jQuery("#temporaryTask_org").html(single_OrgName);
                    $("#temporaryTask_org").css("color", "#333333");
                }
            },
            // 复制
            copyItem: function (e) {
                app.router.navigate(`/createList/0/true/${this.controlName}/${this.orgId}/${this.dutyAccount}/${this.shiftsEndTime}/${this.shiftsStartTime}/${this.createAccount}/${this.dutyUserName}/${this.name}/`, { ignoreCache: true });
            },
            // 编辑
            editItem: function (e) {
                app.router.navigate(`/createList/${this.id}/false/${this.controlName}/${this.orgId}/${this.dutyAccount}/${this.shiftsEndTime}/${this.shiftsStartTime}/${this.createAccount}/${this.dutyUserName}/${this.name}/`, { ignoreCache: true });
            },
            // 删除
            deleteItem: function () {
                let self = this
                push.pushDialog('', '值班记录单', '是否删除?', ["<span style='color:red'>删除</span>", "取消"], function (dialog, index) {
                    if (index != 1) {
                        Dao.deleteShiftsRecord({ shiftsRecordId: self.id }, function () {
                            app.methods.backToTab()
                        })
                    }
                })
            },
            //获取二维码
            getQrcode: function () {
                let self = this
                Dao.getShiftsRecordVisualCode({ shiftsRecordId: self.id }, function (data) {
                    let timestamp;
                    timestamp = (new Date()).getTime();

                    self.visualCode = data.visualCode
                    new QRCode(document.getElementById("qrcode"), {
                        text: data.visualCode + '?' + timestamp,
                        width: 174,
                        height: 174
                    });
                })
            },
            //销毁返回
            // forceBack: function () {
            //     app.view.current.router.back()
            // },
            //弹出失败或者正确

            //现场交班点击事件
            shiftsFun: function () {
                QrStatus = false
                let self = this
                clearInterval(self.time)
             
                Dao.getShiftsRecordVisualCode({ shiftsRecordId: self.id }, function (data) {
                    self.visualCode = data.visualCode
                    let htmlContent = ''
                
                    if (changeShiftsType== 1 && shiftStatus&&changeShiftsId&&changeShiftsId==self.id&&jQuery('#qrcode').length > 0) {

                        htmlContent += `<i class="iconfont icon-kulian-line" style="font-size: 100px;color: #E07762;"></i>
                                <p>交班被拒绝，请修正</p>`
                        shiftStatus = false
                    }
                    else if (changeShiftsType == 0 && shiftStatus&&changeShiftsId&&changeShiftsId==self.id&&jQuery('#qrcode').length > 0) {
                        htmlContent += `<i class="iconfont icon-duigou2" style="font-size: 100px;color: #69BA71;"></i>
                    <p>感谢您的辛勤工作</p>`
                        shiftStatus = false
                      
                    } else {
                        jQuery('#qrcode').empty()
                        htmlContent += `<div id="qrcode" style="width:174px;height:174px;margin:0 auto" @click="refreshTimeStamp"></div>
                                            <p style="text-align:center;margin-top:20px;">请向工作人员出示二维码</p> `
                        shiftStatus = true
                        changeShiftsId=-1
                    }
                    jQuery('#QrBox').remove()
                    let html5 = `
                    <div class="popup dector-popup" id="QrBox"style="height:50%!important;top:20%!important;width: 90%;left: 5%;border-bottom-left-radius: 15px;
                        border-bottom-right-radius: 15px;">
                        <div class="rdsp-dector-popup">
                            <div class="rdsp-dector-popup-bottom">
                                <span class="bind-all-unit" style="font-size:18px; text-align:center;display:block">现场交接班</span>
                                <div class="rdsp-dector-list rdsp-dector-list-height list">
                                    <div class="sort_box" id="dector_sort_list" style="text-align:center">
                                        `+ htmlContent + `
                                    </div>
                                    <div id="letter"></div>
                                </div>
                            </div>
                    </div>
                    <div id="closepupop" style="color:#2471CA;text-align: center;border-bottom: 1px solid #2471CA;position: absolute;z-index: 10600;top: 103%;left: 44%;">关闭</div> 
                    </div>`;
                    creatNewPopup(html5, function () {
                        let timestamp;
                        timestamp = (new Date()).getTime();
                        self.visualCode = data.visualCode
                        if (jQuery('#qrcode').length > 0) {
                            new QRCode(document.getElementById("qrcode"), {
                                text: data.visualCode + '?' + timestamp,
                                width: 174,
                                height: 174
                            });
                            self.setIntervalQr()
                            shiftStatus = false;
                        }
                        jQuery('#qrcode').click(function () {
                            jQuery('#qrcode').empty()
                            self.getQrcode()
                        })
                        jQuery('#closepupop').click(function () {
                            app.popup.close();
                        })
                    })
                })
            },
            //获取详情
            getData: function () {
                let self = this
                let html1 = '';
                let html2 = ''
                let html3 = ''
                let html4 = ''
                jQuery('.shiftsDetailsTop').empty()
                jQuery('.fireWorkItems').empty()
                jQuery('.houseItemsDetails').empty()
                jQuery('.fireCheckItemsDetails').empty()
                //jQuery('#shiftsDetails').empty()
                Dao.selectShiftsRecordDetail({ shiftsRecordId: self.id }, function (data) {
                    self.shiftsEndTime = data.shiftsEndTime == '' ? 'null' : data.shiftsEndTime
                    self.shiftsStartTime = data.shiftsStartTime == '' ? 'null' : data.shiftsStartTime
                    self.dutyAccount = data.dutyAccount
                    self.controlName = data.controlName
                    self.createAccount = data.createAccount
                    self.dutyUserName = data.dutyUserName
                    self.orgId = data.orgId
                    self.status = data.status
                    self.id = data.id
                    self.data = data
                    self.shiftsAccount = data.shiftsAccount
                    self.name = data.orgName
                    // if (userInfor.isMuilUnitUser == 1) {
                    //     single_OrgName=data.name
                    // }
                    if (self.$route.params.name == 1 || self.$route.params.name == 0) {
                        self.shiftsFun()
                    }
                    if (data.status == 0 && data.dutyAccount.split(',').indexOf(userInfor.accountName) > -1) {
                        jQuery('.fixedBtnShifts').show();
                    } else {
                        jQuery('#editItem').hide()
                        jQuery('#deleteItem').hide()
                        jQuery('.fixedBtnShifts').hide()
                    }
                    if (self.$route.params.name == 0) {//成功交班
                        jQuery('.fixedBtnShifts').hide()
                    }
                    let dutyUserList = data.dutyUserList
                    html1 += `      <ul class="shiftsDetails line-bottom">
                    <li class="${data.status == 0 ? 'onDuty' : (data.status == 1 ? 'successFulDuty' : 'noDuty')}">${data.status == 0 ? '值班中' : (data.status == 1 ? '成功交班' : '未完成交班')}</li>
                    <li class="section-title">
                        ${data.shiftsName}
                    </li>
                    <li>
                        <div class="flex-label">所属单位</div>
                        <div>${data.orgName}</div>
                    </li>
                    <li>
                        <div>值班人员</div>
                       
                    </li>
                    <li>
                            <div class="dutyName">`
                    if (dutyUserList.length > 0) {
                        for (let i = 0; i < dutyUserList.length; i++) {
                            html1 += `<a href="tel:${dutyUserList[i].tel}" onclick = "window.location='tel:` + dutyUserList[i].tel + `'" >
                                    <img src="${dutyUserList[i].headUrl == null ? staticPath + 'img/mine/defaulticon.png' : dutyUserList[i].headUrl}" alt="">
                                    <p>${dutyUserList[i].name}</p>
                                </a>`
                        }
                    }
                    html1 += `</div>`
                    html1 += `</li>`
                    html1 += `<li>
                        <div class="flex-label">所在消控室</div>
                        <div>${data.controlName}</div>
                    </li>
                    <li>
                        <div class="flex-label">开始时间</div>
                        <div>${data.shiftsStartTime.substring(0, 4)}年${data.shiftsStartTime.substring(5, 7)}月${data.shiftsStartTime.substring(8, 10)}日${data.shiftsStartTime.substring(10, 16)}</div>
    
                    </li>
                    <li>
                        <div class="flex-label">结束时间</div>
                        <div>${data.shiftsEndTime.substring(0, 4)}年${data.shiftsEndTime.substring(5, 7)}月${data.shiftsEndTime.substring(8, 10)}日${data.shiftsEndTime.substring(10, 16)}</div>
                    </li>
                </ul>
               
                <div class="changeShiftsResult line-bottom ${data.status != 0 ? 'domShow' : ''}">
                    <div class="section-title">
                        交接情況
                    </div>
                    <div class="changeShiftsResultLabel">
                        接班人员
                    </div>
                    <div class="dutyName">`
                    let shiftsUserList = data.shiftsUserList
                    if (shiftsUserList.length > 0) {
                        for (let i = 0; i < shiftsUserList.length; i++) {
                            html1 += `<a href="tel:${shiftsUserList[i].tel}" onclick = "window.location='tel:` + shiftsUserList[i].tel + `'">
                                    <img src="${shiftsUserList[i].headUrl == null ? staticPath + 'img/mine/defaulticon.png' : shiftsUserList[i].headUrl}" alt="">
                                    <p>${shiftsUserList[i].name}</p>
                                </a>`
                        }
                    }
                    html1 += `</div>
                    <div><span class="changeShiftsResultLabel flex-label">交接班时间</span><span style="margin-left:20px">${data.shiftsTime == null ? '' : data.shiftsTime.substring(0, 4) + '年' + data.shiftsTime.substring(5, 7) + '月' + data.shiftsTime.substring(8, 10) + '日' + data.shiftsTime.substring(10, 16)}</span></div>
                </div>`
                    html2 += `  <div class="fireWorkItemsTitle"><span>一、火灾报警控制运行情况</span></div>
                        <ul id="fireWorkItems">`
                    let alarmCountList = data.alarmCountList
                    if (alarmCountList.length > 0) {
                        for (let i = 0; i < alarmCountList.length; i++) {
                            html2 += `<li class="tableItem">
                                <div class="flex-between tableItemClick"><div class="tableItemTitle"><span>${alarmCountList[i].createTime.substring(5, 7)}月${alarmCountList[i].createTime.substring(8, 10)}日${alarmCountList[i].createTime.substring(11)}</span>
                                <span>由${alarmCountList[i].createUserName}记录</span>
                                </div>
                                <i class="iconfont icon-xiala" style="font-size:20px;color:#999999"></i>
                            </div>
                                <div class="fireWorkItemsDetails tableDetails">
                         
                            <table cellspacing="0">
                                <tr>
                                    <th>状态</th>
                                    <th>火警</th>
                                    <th>误报</th>
                                    <th>故障</th>
                                    <th>监管</th>
                                    <th>漏报</th>
                                </tr>
                                <tr>
                                    <td>${alarmCountList[i].runStatus == 0 ? '√' : '×'}</td>
                                    <td style="color:#E07762">${alarmCountList[i].fireAlarmCount}</td>
                                    <td>${alarmCountList[i].errorReportCount}</td>
                                    <td style="color:#E6AE05">${alarmCountList[i].faultAlarmCount}</td>
                                    <td>${alarmCountList[i].superviseAlarmCount}</td>
                                    <td>${alarmCountList[i].missReportCount}</td>
                                </tr>
                            </table>
                            <div class="introduceDetails">
                                <div>报警、故障说明：</div>   
                                <div class="introduce-text">${alarmCountList[i].handleDesc}</div> 
                            </div>
                        </div>
                            </li>`
                        }
                    }
                    html2 += `<li class="addList  addListClick ${data.status == 0 && !QrStatus && data.dutyAccount.split(',').indexOf(userInfor.accountName) > -1 ? 'domShow' : ''}"><span>+</span> <span style="font-size:14px;">添加</span></li>`
                    html2 += ` </ul>
                    </div>`

                    html3 += `   <div class="fireWorkItemsTitle"><span>二、控制室其他消防系统运行情况</span></div>
                        <ul id="houseItemsDetails">`
                    let systemStatusList = data.systemStatusList
                    for (let i = 0; i < systemStatusList.length; i++) {
                        html3 += `<li class="tableItem">
                                <div class="flex-between tableItemClick"><div class="tableItemTitle"><span>${systemStatusList[i].createTime}</span>
                                <span>由${systemStatusList[i].createUserName}记录</span>
                                </div>
                                <i class="iconfont icon-xiala" style="font-size:20px;color:#999999"></i>
                            </div>
                                <div class="fireWorkItemsDetails tableDetails">
                         
                            <table cellspacing="0">
                                <tr>
                                    <th>系统/设备名称</th>
                                    <th style="width:70px;">控制状态</th>
                                    <th style="width:70px;">运行状态</th>
                                    <th style="width:40px;">故障</th>
                         
                                </tr>
                                <tr>
                                    <td>${systemStatusList[i].name}</td>
                                    <td style="color:#E07762">${systemStatusList[i].systemStatus == 0 ? '自动' : '手动'}</td>
                                    <td>${systemStatusList[i].faultCount == 0 ? "正常" : '故障'}</td>
                                    <td style="color:#E6AE05">${systemStatusList[i].faultCount}</td>
                                  
                                </tr>
                            </table>
                            <div class="introduceDetails">
                                <div>报警、故障说明：</div>   
                                <div class="introduce-text">${systemStatusList[i].handleDesc}</div> 
                            </div>
                        </div>
                            </li>`
                    }
                    html3 += `<li class="addList addListClick ${data.status == 0 && !QrStatus && data.dutyAccount.split(',').indexOf(userInfor.accountName) > -1 ? 'domShow' : ''}"><span>+</span> <span style="font-size:14px;">添加</span></li>`
                    html3 += ` </ul>
                    </div>`

                    html4 += `<div class="fireWorkItemsTitle"><span>三、火灾报警控制器日检查情况记录</span></div>
                        <ul id="fireCheckItems">`
                    let controllerStatusList = data.controllerStatusList
                    if (controllerStatusList.length > 0) {
                        for (let i = 0; i < controllerStatusList.length; i++) {
                            html4 += `<li class="tableItem">
                                <div class="flex-between tableItemClick"><div class="tableItemTitle"><span>${controllerStatusList[i].createTime}</span>
                                <span>由${controllerStatusList[i].createUserName}记录</span>
                                </div>
                                <i class="iconfont icon-xiala" style="font-size:20px;color:#999999"></i>
                            </div>
                                <div class="fireWorkItemsDetails tableDetails">
                         
                            <table cellspacing="0">
                                <tr>
                                    <td colspan="3" style="width: 140px;">系统/设备名称</td>
                                    <td colspan="2">${controllerStatusList[i].name}</td>
                                </tr>
                                <tr>
                                    <td colspan="5">检查结果</td>
                                    </tr>  
                                    <tr>
                                        <th>自检</th>
                                        <th>消音</th>
                                        <th>复位</th>
                                        <th>主电源</th>
                                        <th>备用电源</th>
                                        </tr>
                                <tr>
                                    <td>${controllerStatusList[i].selfCheck == 0 ? '√' : (controllerStatusList[i].selfCheck == 1 ? '×' : '/')}</td>
                                    <td >${controllerStatusList[i].silencing == '0' ? '√' : (controllerStatusList[i].silencing == 1 ? '×' : '/')}</td>
                                    <td >${controllerStatusList[i].reset == '0' ? '√' : (controllerStatusList[i].reset == 1 ? '×' : '/')}</td>
                                    <td >${controllerStatusList[i].mainPower == '0' ? '√' : (controllerStatusList[i].mainPower == 1 ? '×' : '/')}</td>
                                    <td>${controllerStatusList[i].standbyPower == '0' ? '√' : (controllerStatusList[i].standbyPower == 1 ? '×' : '/')}</td>
                                
                                </tr>
                            </table>
                            <div class="introduceDetails">
                                <div>报警、故障说明：</div>   
                                <div class="introduce-text">${controllerStatusList[i].handleDesc}</div> 
                            </div>
                        </div>
                            </li>`
                        }
                    }
                    html4 += `<li class="addList addListClick ${data.status == 0 && !QrStatus && data.dutyAccount.split(',').indexOf(userInfor.accountName) > -1 ? 'domShow' : ''}"><span>+</span> <span style="font-size:14px;">添加</span></li>`
                    html4 += ` </ul>
                    </div>`

                    jQuery('.shiftsDetailsTop').append(html1)
                    jQuery('.fireWorkItems').append(html2)
                    jQuery('.houseItemsDetails').append(html3)
                    jQuery('.fireCheckItemsDetails').append(html4)
                    $('.page-content').scrollTop(self.scollH + 20)
                    // jQuery('#shiftsDetails').append(html)
                    jQuery('.tableItemClick').each(function (e) {
                        jQuery(this).click(function () {
                            if (jQuery('i', this).hasClass('icon-xiala')) {

                                jQuery(this).next('.tableDetails').stop().slideDown()
                                jQuery('i', this).removeClass('icon-xiala').addClass('icon-shouqi')

                            } else {
                                jQuery(this).next('.tableDetails').stop().slideUp()
                                jQuery('i', this).removeClass('icon-shouqi').addClass('icon-xiala')
                            }

                        })
                    })
                    jQuery('.addListClick').each(function (e) {
                        jQuery(this).click(function (name) {
                            self.runStatus = 0;
                            self.systemStatus = 0;
                            self.zj = 0;
                            self.xy = 0;
                            self.fw = 0;
                            self.zdy = 0;
                            self.bydy = 0;
                            self.fireAlarmCount = 0, self.errorReportCount = 0, self.faultAlarmCount = 0, self.superviseAlarmCount = 0, self.missReportCount = 0
                            if (e == 0) {
                                let html = `
                                <div class="popup dector-popup">
                                    <div class="rdsp-dector-popup" style="height:100%">
                                        <div class="rdsp-dector-popup-bottom" style="height:100%">
                                            <span class="bind-all-unit" style="font-size:18px; text-align:center;display:block">火灾报警控制器运行情况</span>
                                            <div class="rdsp-dector-list rdsp-dector-list-height list" style="padding-bottom: 0;margin: 5px 0">
                                                <div class="sort_box" id="dector_sort_list" style="overflow-y:auto;height:calc(100% - 65px)">
                                                        <div>
                                                            <ul class="popup-fire-content">
                                                                <li>
                                                                    <div class="popup-label">运行</div>
                                                                    <div class="poupp-right tabClick">
                                                                        <div  class="tab popup-active" data-type="0">正常</div>
                                                                        <div  class="tab" data-type="1">故障</div>
                                                                    </div>
                                                                </li>
                                                                <li>
                                                                    <div class="popup-label">火警数</div>  
                                                                    <div class="poupp-right">
                                                                        <div class="jian">-</div>
                                                                        <input type='number' data-type="fireAlarmCount" placeholder="0"/>
                                                                        <div class="jia">+</div>
                                                                    </div>  
                                                                </li>   
                                                                <li>
                                                                    <div class="popup-label">误报数</div>  
                                                                    <div class="poupp-right">
                                                                        <div class="jian">-</div>
                                                                        <input type='number' data-type="errorReportCount"  placeholder="0"/>
                                                                        <div class="jia">+</div>
                                                                    </div>  
                                                                </li>  
                                                                <li>
                                                                    <div class="popup-label">故障报警数</div>  
                                                                    <div class="poupp-right">
                                                                        <div class="jian">-</div>
                                                                       <input type='number' data-type="faultAlarmCount" placeholder="0"/>
                                                                        <div class="jia">+</div>
                                                                    </div>  
                                                                </li>  
                                                                <li>
                                                                    <div class="popup-label">监管报警数</div>  
                                                                    <div class="poupp-right">
                                                                        <div class="jian">-</div>
                                                                        <input type='number' data-type="superviseAlarmCount" placeholder="0"/>
                                                                        <div class="jia">+</div>
                                                                    </div>  
                                                                </li>  
                                                                <li>
                                                                    <div class="popup-label">漏报数</div>  
                                                                    <div class="poupp-right">
                                                                        <div class="jian">-</div>
                                                                      <input type='number' data-type="missReportCount" placeholder="0"/>
                                                                        <div class="jia">+</div>
                                                                    </div>  
                                                                </li>
                                                                <div style="margin:30px 0 0 0">报警、故障处理情况说明</div>    
                                                                <textarea placeholder="输入说明文字" class="popup-textarea textareaReduce1 textareaReduce"></textarea>
                                                            </ul>    
                                                        </div>
                                                </div>
                                                <div id="letter"></div>
                                            </div>
                                        </div>
                                        <div class="popupBtnFixed">
                                            <div class="popup-cancel">取消</div>
                                            <div class="popup-confirm">确定</div>
                                            </div>
                                </div>
                                </div>`;
                                creatNewPopup(html, function () {
                                    jQuery('body').off('click', '.tab').on('click', '.tab', function () {
                                        jQuery(this).addClass('popup-active').siblings('.tab').removeClass('popup-active')
                                        self.runStatus = jQuery(this).attr('data-type')
                                    })
                                    jQuery('.jia').each(function () {
                                        jQuery(this).click(function () {
                                            jQuery(this).prev('input').val(Number(jQuery(this).prev('input').val()) + 1)
                                            self[jQuery(this).prev('input').attr('data-type')] = jQuery(this).prev('input').val()

                                        })
                                    })
                                    jQuery('.jian').each(function () {
                                        jQuery(this).click(function () {
                                            if (jQuery(this).next('input').val() > 0) {
                                                jQuery(this).next('input').val(Number(jQuery(this).next('input').val()) - 1)
                                                self[jQuery(this).next('input').attr('data-type')] = jQuery(this).next('input').val()
                                            }
                                        })
                                    })
                                    jQuery('body').off('click', '.popup-confirm').on('click', '.popup-confirm', function () {
                                        self.scollH = jQuery('.fireWorkItems').offset().top

                                        let params = {
                                            shiftsRecordId: self.id,
                                            runStatus: self.runStatus,
                                            fireAlarmCount: self.fireAlarmCount,
                                            errorReportCount: self.errorReportCount,
                                            faultAlarmCount: self.faultAlarmCount,
                                            superviseAlarmCount: self.superviseAlarmCount,
                                            missReportCount: self.missReportCount,
                                            handleDesc: jQuery('.textareaReduce1').val(),
                                            userName: self.userName
                                        }

                                        Dao.saveShiftsAlarmCount(params, function () {
                                            app.popup.close();
                                            self.flagAppend = false
                                            self.getData()
                                        })
                                    })
                                    jQuery('body').off('click', '.popup-cancel').on('click', '.popup-cancel', function () {
                                        app.popup.close();
                                    })
                                })
                            } else if (e == 1) { //控制室其他消防系统运行情况
                                let html2 = `
                                <div class="popup dector-popup" style="height:74%!important">
                                    <div class="rdsp-dector-popup">
                                        <div class="rdsp-dector-popup-bottom">
                                            <span class="bind-all-unit" style="font-size:18px; text-align:center;display:block;margin-bottom:10px">控制室其他消防系统运行情况</span>
                                            <div class="rdsp-dector-list rdsp-dector-list-height list">
                                                <div class="sort_box" id="dector_sort_list" >
                                                        <div>
                                                            <ul class="popup-fire-content">
                                                                
                                                                <div style="margin:30px 0 0 0"><span style="color:red">*</span>系统/设备名称</div>    
                                                                <textarea placeholder="输入系统/设备名称" class="popup-textarea textareaName"></textarea>
                                                                <li>
                                                                    <div class="popup-label">控制状态</div>
                                                                    <div class="poupp-right tabClick">
                                                                        <div  class="tab popup-active" data-type="0">自动</div>
                                                                        <div  class="tab" data-type="1">手动</div>
                                                                    </div>
                                                                </li>
                                                                <li>
                                                                    <div class="popup-label">故障数</div>  
                                                                    <div class="poupp-right">
                                                                        <div class="jian">-</div>
                                                                       <input type='number' data-type="faultAlarmCount" placeholder="0"/>
                                                                        <div class="jia">+</div>
                                                                    </div>  
                                                                </li>  
                                                                
                                                                <div style="margin:30px 0 0 0">报警、故障处理情况说明</div>    
                                                                <textarea placeholder="输入说明文字" class="popup-textarea textareaReduce2"></textarea>
                                                            </ul>    
                                                        </div>
                                                </div>
                                                <div id="letter"></div>
                                            </div>
                                        </div>
                                        <div class="popupBtnFixed">
                                            <div class="popup-cancel">取消</div>
                                            <div class="popup-confirm">确定</div>
                                            </div>
                                </div>
                                </div>`;
                                creatNewPopup(html2, function () {
                                    jQuery('body').off('click', '.tab').on('click', '.tab', function () {
                                        jQuery(this).addClass('popup-active').siblings('.tab').removeClass('popup-active')
                                        self.systemStatus = jQuery(this).attr('data-type')
                                    })
                                    jQuery('.jia').each(function () {
                                        jQuery(this).click(function () {
                                            jQuery(this).prev('input').val(Number(jQuery(this).prev('input').val()) + 1)
                                            self[jQuery(this).prev('input').attr('data-type')] = jQuery(this).prev('input').val()

                                        })
                                    })
                                    jQuery('.jian').each(function () {
                                        jQuery(this).click(function () {
                                            if (jQuery(this).next('input').val() > 0) {
                                                jQuery(this).next('input').val(Number(jQuery(this).next('input').val()) - 1)
                                                self[jQuery(this).next('input').attr('data-type')] = jQuery(this).next('input').val()
                                            }
                                        })
                                    })
                                    jQuery('body').off('click', '.popup-confirm').on('click', '.popup-confirm', function () {
                                        self.scollH = jQuery('.houseItemsDetails').offset().top
                                        let params = {
                                            shiftsRecordId: self.id,
                                            name: jQuery('.textareaName').val(),
                                            systemStatus: self.systemStatus,
                                            faultCount: self.faultAlarmCount,
                                            handleDesc: jQuery('.textareaReduce2').val(),
                                            userName: self.userName
                                        }
                                        if (jQuery('.textareaName').val() == '') {
                                            app.methods.showToastCenter('系统/设备名称不能为空')
                                        } else {

                                            Dao.saveShiftsSystemStatus(params, function () {
                                                app.popup.close();
                                                self.flagAppend = false
                                                self.getData()

                                            })
                                        }
                                    })
                                    jQuery('body').off('click', '.popup-cancel').on('click', '.popup-cancel', function () {
                                        app.popup.close();
                                    })
                                })
                            } else {
                                let html3 = `
                                <div class="popup dector-popup">
                                    <div class="rdsp-dector-popup" style="height:100%">
                                        <div class="rdsp-dector-popup-bottom" style="height:100%">
                                            <span class="bind-all-unit" style="font-size:18px; text-align:center;display:block">火灾报警控制器日检查情况记录</span>
                                            <br/>
                                            <div class="rdsp-dector-list rdsp-dector-list-height list" style="padding-bottom:0;margin:5px 0;height:100%">
                                                <div class="sort_box" id="dector_sort_list" style="overflow-y:auto;height:calc(100% - 84px)">
                                                        <div>
                                                            <ul class="popup-fire-content">
                                                                <div style="margin:30px 0 0 0"><span style="color:red">*</span>控制器型号</div>    
                                                                <textarea placeholder="输入控制器型号" class="popup-textarea textareaName3"></textarea>
                                                                <li>
                                                                    <div class="popup-label">自检</div>
                                                                    <div class="poupp-right tabClick">
                                                                        <div  class="tab popup-active" data-type="0" data-name="zj">正常</div>
                                                                        <div  class="tab" data-type="1" data-name="zj">异常</div>
                                                                        <div  class="tab" data-type="2" data-name="zj">未涉及</div>
                                                                    </div>
                                                                </li>
                                                                <li>
                                                                    <div class="popup-label">消音</div>
                                                                    <div class="poupp-right tabClick">
                                                                        <div  class="tab popup-active" data-type="0" data-name="xy">正常</div>
                                                                        <div  class="tab" data-type="1" data-name="xy">异常</div>
                                                                        <div  class="tab" data-type="2" data-name="xy">未涉及</div>
                                                                    </div>
                                                                </li>
                                                                <li>
                                                                    <div class="popup-label">复位</div>
                                                                    <div class="poupp-right tabClick">
                                                                        <div  class="tab popup-active" data-type="0" data-name="fw">正常</div>
                                                                        <div  class="tab" data-type="1" data-name="fw">异常</div>
                                                                        <div  class="tab" data-type="2" data-name="fw">未涉及</div>
                                                                    </div>
                                                                </li>
                                                                <li>
                                                                    <div class="popup-label">主电源</div>
                                                                    <div class="poupp-right tabClick">
                                                                        <div  class="tab popup-active" data-type="0" data-name="zdy">正常</div>
                                                                        <div  class="tab" data-type="1" data-name="zdy">异常</div>
                                                                        <div  class="tab" data-type="2" data-name="zdy">未涉及</div>
                                                                    </div>
                                                                </li>
                                                                <li>
                                                                    <div class="popup-label">备用电源</div>
                                                                    <div class="poupp-right tabClick">
                                                                        <div  class="tab popup-active" data-type="0" data-name="bydy">正常</div>
                                                                        <div  class="tab" data-type="1" data-name="bydy">异常</div>
                                                                        <div  class="tab" data-type="2" data-name="bydy">未涉及</div>
                                                                    </div>
                                                                </li>
                                                                
                                                                <div style="margin:30px 0 0 0">报警、故障处理情况说明</div>    
                                                                <textarea placeholder="请在这里简洁明了描述原因与处理" class="popup-textarea textareaReduce3"></textarea>
                                                            </ul>    
                                                        </div>
                                                </div>
                                                <div id="letter"></div>
                                            </div>
                                        </div>
                                        <div class="popupBtnFixed">
                                            <div class="popup-cancel">取消</div>
                                            <div class="popup-confirm">确定</div>
                                            </div>
                                </div>
                                </div>`;
                                creatNewPopup(html3, function () {
                                    jQuery('body').off('click', '.tab').on('click', '.tab', function () {
                                        jQuery(this).addClass('popup-active').siblings('.tab').removeClass('popup-active')
                                        self[jQuery(this).attr('data-name')] = jQuery(this).attr('data-type')
                                    })
                                    jQuery('.jia').each(function () {
                                        jQuery(this).click(function () {
                                            jQuery(this).prev('input').val(Number(jQuery(this).prev('input').val()) + 1)
                                            self[jQuery(this).prev('input').attr('data-type')] = jQuery(this).prev('input').val()

                                        })
                                    })
                                    jQuery('.jian').each(function () {
                                        jQuery(this).click(function () {
                                            if (jQuery(this).next('input').val() > 0) {
                                                jQuery(this).next('input').val(Number(jQuery(this).next('input').val()) - 1)
                                                self[jQuery(this).next('input').attr('data-type')] = jQuery(this).next('input').val()
                                            }
                                        })
                                    })
                                    jQuery('body').off('click', '.popup-confirm').on('click', '.popup-confirm', function () {
                                        self.scollH = jQuery('.fireCheckItemsDetails').offset().top

                                        let params = {
                                            shiftsRecordId: self.id,
                                            name: jQuery('.textareaName3').val(),
                                            selfCheck: self.zj,
                                            silencing: self.xy,
                                            reset: self.fw,
                                            mainPower: self.zdy,
                                            standbyPower: self.bydy,
                                            handleDesc: jQuery('.textareaReduce3').val(),
                                            userName: self.userName
                                        }
                                        if (jQuery('.textareaName3').val() == '') {
                                            app.methods.showToastCenter('控制器型号不能为空')
                                        } else {

                                            Dao.saveShiftsControllerStatus(params, function () {
                                                app.popup.close();
                                                self.flagAppend = false

                                                self.getData()
                                            })
                                        }
                                    })
                                    jQuery('body').off('click', '.popup-cancel').on('click', '.popup-cancel', function () {
                                        app.popup.close();
                                    })
                                })
                            }
                        })
                    })
                })
            }
        },

    }
</script>